package org.example.user.manage.form;

import lombok.Data;
import org.example.commons.constant.Constants;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/**
 * 住户的查询表单实体
 *
 * @author bothin
 */
@Data
public class SysUserSearchForm {
    private Integer page = 1;
    private Integer size = 10;
    private Boolean isAsc = true;
    private String field = "";

    /**
     * 微信openid
     */
    private String openid = "";
    /**
     * 姓名
     */
    private String name = "";
    /**
     * 手机号
     */
    private String phone = "";
    /**
     * 身份证
     */
    private String idCard = "";
    /**
     * 用户性别（0男 1女 2未知）
     */
    private Integer sex;
    /**
     * 帐号状态（0停用 1正常）
     */
    private Integer status;
    /**
     * 地址
     */
    private String address = "";
    /**
     * 房号信息
     */
    private String houseInfo = "";

    private Date[] dates;

    public Date[] getDates() {
        if (dates==null || dates.length<2){
            dates = new Date[2];
        }

        if (StringUtils.isEmpty(dates[0])) //如果没有传查询时间，初始化
            dates[0] = null;
        if (StringUtils.isEmpty(dates[1]))
            dates[1] = null;
        return dates;
    }

}
